#pragma once

#include <vector>

#include "API.h"
#include "IBoard.h"

namespace snake
{

  /**
    Class Board - default implementation of interface IBoard
  */
  class SNAKE_API Board
    : public IBoard
  {
  public:
    /// Constructor
    /// will throw if either width or height is zero
    Board(size_t width, size_t height);

    Board(const Board &);

    Board &operator=(const Board &);

    ~Board();

    /// @see IBoard::GetWidth
    virtual size_t GetWidth() const override;

    /// @see IBoard::GetHeight
    virtual size_t GetHeight() const override;

    /// @see IBoard::IsCellFree
    virtual bool IsCellFree(size_t x, size_t y) const override;

    /// @see IBoard::GetCell
    virtual ECellContents GetCell(size_t x, size_t y) const override;

    /// @see IBoard::SetCell
    virtual void SetCell(size_t x, size_t y, ECellContents contents) override;

  private:
    class Impl;
    Impl *p_impl_;
  };

}